// 整数-》10000000 => 10,000,000

// ?=前瞻，匹配数子前的那个位置，  \B非单词边界
function getMonye(num) {
  var a = (num + "").replace(/(?=\B(\d{3})+$)/g, ",");
  return a;
}

console.log("[ getMonye ] >", getMonye(10000000));

let str = "100000000";
console.log("[ 111 ] >", str.replace(/(\d{3})+$/g, ","));
console.log("[ 222 ] >", str.replace(/(?=(\d{3})+$)/g, ","));
console.log("[ 333 ] >", str.replace(/(?=\B(\d{3})+$)/g, ","));
